home *** CD-ROM | disk | FTP | other *** search
- Path: krtkg1.rug.ac.be!colle
- From: Christophe Colle <colle@krtkg1.rug.ac.be>
- Newsgroups: comp.lang.c
- Subject: symbol type at runtime
- Date: Wed, 20 Mar 1996 17:08:12 +0100
- Organization: University of Ghent, Belgium
- Message-ID: <Pine.OSF.3.91.960320170224.19850A-100000@krtkg1.rug.ac.be>
- NNTP-Posting-Host: krtkg1.rug.ac.be
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
- Hi all,
-
- I wonder if there is a way to find out the type of a variable at runtime,
- without using tricks like #define etc.
-
- eg:
-
- char array[10];
-
- int function(int blah, char *ptr)
- {
- /* in this function i want to find the exact type of the variabl which
- is passed in ptr. I want to find a char array[10] and not char *
- when called with function(blah, array);
- /*
-
- main()
- {
- function(0, array);
- }
-
- I think I should be able to get the exact type of the variables by
- examing the stack frames, but I never did it and I have only man-pages
- which aren't enough. Are there some people around who could tell me on
- how to do what I want, or give me some links to good reference materials
- and examples? I'm running on a DEC-ALPHA.
-
- Any help is appreciated. Thanks in advance.
-
-
- Christophe Colle
-
- | \ =============================================================
- | \ Colle Christophe Phone: +32-(0)9-2403955
- +---- mail: colle@krtkg1.rug.ac.be http://krtkg1.rug.ac.be/~colle
- |
- ----------+ When I'm not in Ghent, Then I'm probably Sailing
- \________| ======= Radiotherapy Department, Ghent =============
-
-